from AudioFx import AudioSlot
from pyo import *
from pref import prefs
circle = [0,1,7,2,6,3,5,4]

def circleAudio(sig):
    return Sig([sig[i] for i in circle])

class SR_PAN(AudioSlot):
    
    """
    example audio process
    """
    name = "SR_PAN"
    ctrls = ["pan","spread","none"]
    def __init__(self):
        AudioSlot.__init__(self, "fx",self.name,self.ctrls)
        self.pan = Pan(
                    input=self.input,
                    pan = self.ctrl1,
                    spread = self.ctrl2,
                    outs=prefs["channels"])
        self.output = circleAudio(self.pan)
        self.addOff(self.pan)
        self.initVals = [1,0,1]






name = "surroundFX"
slotType = "fx"
modulesDict = {0:{"class":SR_PAN}
                }

# for i in range(16):
#   modulesDict["fx"][i+3] = {"class":Filter} 
for i, slot in modulesDict.items():
    slot["name"] = slot["class"].name
    slot["ctrls"] = slot["class"].ctrls
